home *** CD-ROM | disk | FTP | other *** search
- >
- > Ive managed to get a copy of devPac, and am not sure on how to integrate any
- > kind of assembler into AMOS. Someone did explain the basics of Dreg to me,
- > but I still dont quite get it.
-
- It's basically very simple. You first need to code something in PC-relative
- code. That means that stuff like jsr and jmp are out of the question; in-
- structions like 'lea Data, a3' should be coded as 'lea Data(pc), a3'. If
- you neglect these requirements you'd better make sure you have your ticket
- to India handy. Your code should also be one segment. Finally, Devpac is
- not capable of writing out raw code, it always wraps a set of hunks around
- your code. You need to remove these hunks manually before you load the code
- into AMOS. (It's not hard, if you stick to PC-relative code and 1 code
- segment, you just need to remove the first 32 bytes and the last 4 bytes.)
-
- Of course, you can circumvent these problems, but then you need to call
- on LoadSeg() to load your code into memory. I have never tried this, but
- I see no reason why this should fail.
-
- Lets assume an example:
-
- addq.l #8, d1
- rts
-
- This code adds 8 to the register d1. You can Poke the code into memory your-
- self, it's just four bytes. I've assumed this is done in bank 10. Next you
- program in AMOS:
-
- Dreg(1)=100
- Call Start(10)
- RESULT=Dreg(1)
-
- which should yield 108 as the answer. I've forgotten whether 'call' is the
- right instruction, but you probably get the idea. First you setup d1 to
- contain 100, then you call your small program. That simply adds 8 to what-
- ever is stored in d1, and then returns. AMOS then reads what is inside
- d1 -- 108.
-
- Using this technique, I've written a small program which converts AMOS'
- FFP numbers into IEEE-compliant ones; I could then use my FPU from within
- AMOS 1.36. It's not easy to do (AMOS Pro solved this problem on a much
- better level) but it worked!
-
- > Can someone send me an ASM program, which can be merged into AMOS, and
- > explain to me how to use it. I would like to write an ASM version of ZOOM,
- > and would be interested in routines which will draw onto the screen, or draw
- > to mem for a c2p routine.
-
- There are plenty of asm-c2p routines available on Aminet; if you change
- the screen base to point to the memory region where AMOS stores the bitplanes
- you're in business. I believe it's Screen Base or Phybase which gives you
- the required addresses. There was a special demo on the Amos Classic Compiler
- disk illustrating a certain effect programmed with ML. You should take a look
- at this.
-
- However, if you are not familiar with assembly language, I'd advise you to
- study that first. There is no point in messing with it if you don't know
- the limitations and possibilities.
-
- Hope this helps a bit,
- Maarten
-
-
-